{% if user.is_authenticated %}
  <p>Welcome, {{ user.username }}. Thanks for logging in.</p>
{% else %}
  <p>Welcome, new user. Please <a href="/accounts/login/">log in</a>.</p>
{% endif %}